package training.minggu5.maven.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="t_penjualan_header")
public class PenjualanHeader implements Serializable {

    @Id
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid",strategy="uuid")
    @Column(name="no_faktur")
    private String noFaktur;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    @Column(name="tanggal")
    private Date tanggal;

    @Column(name="nama_konsumen")
    private String nama_konsumen;

    @Column(name="list_penjualan_detail")
    @OneToMany(mappedBy = "det_penjualan_header")
    @Cascade(CascadeType.ALL)
    private List<PenjualanDetail> list_penjualan_detail;

    public List<PenjualanDetail> getList_penjualan_detail() {
        return list_penjualan_detail;
    }

    public void setList_penjualan_detail(List<PenjualanDetail> list_penjualan_detail) {
        this.list_penjualan_detail = list_penjualan_detail;
    }

    public String getNama_konsumen() {
        return nama_konsumen;
    }

    public void setNama_konsumen(String nama_konsumen) {
        this.nama_konsumen = nama_konsumen;
    }

    public String getNoFaktur() {
        return noFaktur;
    }

    public void setNoFaktur(String noFaktur) {
        this.noFaktur = noFaktur;
    }

    public Date getTanggal() {
        return tanggal;
    }

    public void setTanggal(Date tanggal) {
        this.tanggal = tanggal;
    }

    
}
